import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from "@/views/LoginView.vue";
import RegisterView from "@/views/RegisterView.vue";
import ToDoList from "@/views/ToDoList.vue";
import secondlist from "@/views/secondlist.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'todolist',
      component: ToDoList,
      children:[
        {
          path:'/l2/:id/:date/:state',
          name:secondlist,
          component: secondlist,
        }
      ]
    },
    {
      path: '/login',
      name: 'LoginView',
      component: LoginView,
    },
    {
      path: '/register',
      name: 'RegisterView',
      component: RegisterView,
    }
  ],
})
router.beforeEach((to, from) => {
  if (to.fullPath != "/login" && to.fullPath != "/register"){

  }
})
export default router
